/*
 * Table.h
 *
 *  Created on: 13-Feb-2013
 *      Author: abhijeet
 */

#ifndef TABLE_H_
#define TABLE_H_

#include <map>
#include <cstring>
#include <iostream>
#include "Def.h"

using namespace std;

class compare {
public:
	bool operator()(const char *l, const char * r) {
		if (strcmp(l, r) < 0)
			return true;
		else
			return false;
	}
};

typedef map<char *, char *, compare> StringToStringMap;
typedef pair<char *, char *> StringPair;

class Table {

	StringToStringMap RTable;
	StringToStringMap ITable;
	StringToStringMap::iterator it;
	InstType type;

public:
	Table();
	~Table();

	//Find the upcode name in the symbol table
	//Return 1 on success and 0 on failure
	int GetUpcodeName(char * upcode, char * upCodeName, InstType);
};


#endif /* TABLE_H_ */
